package com.tcm.order.service.settlement;


import com.base.genid.generator.UidGenerator;
import com.tcm.order.entity.SettlementOrderMonth;
import com.tcm.order.dao.mapper.SettlementOrderMonthMapper;
import com.tcm.order.service.SettlementOrderMonthService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService(version = "0.0.1-alpha", timeout = 6000, retries = 3, delay = -1)
public class SettlementOrderMonthServiceImpl implements SettlementOrderMonthService {

    @Autowired
    private SettlementOrderMonthMapper settlementOrderMonthMapper;

    @DubboReference(version = "0.0.1-beta", group = "cached-uid", timeout = 6000, check = false, retries = 3)
    private UidGenerator uidGenerator;

    @Override
    public void create(SettlementOrderMonth settlementOrderMonth) {
        settlementOrderMonth.setId(uidGenerator.getUID());
        settlementOrderMonthMapper.insert(settlementOrderMonth);
    }

}
